﻿Imports System.IO
Imports System.Xml
Public Class frmTest
    Private Sub cmdSingleDCL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSingleDCL.Click
        '读取所有行
        ReadFileToPL1Source("C:\ConversionTool\TestData\UT\SingleDCL\IN.txt")
        '将COPY句整理成为单句
        FormatPL1Source()
        '分析指定行
        mXmlDocument = New XmlDocument
        txtPl1Source.Text = PL1Source(0)
        Using TestWriter As StreamWriter = New IO.StreamWriter("C:\ConversionTool\TestData\UT\SingleDCL\OUT.xml")
            For Each SingleNode In clsDataDefine.SingleDCL(PL1Source(0))
                TestWriter.Write(SingleNode.OuterXml)
            Next
        End Using
        WebBrowser1.Url = New Uri("C:\ConversionTool\TestData\UT\SingleDCL\OUT.xml")
    End Sub
    Private Sub cmdMultiSingleDCL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMultiSingleDCL.Click
        '读取所有行
        ReadFileToPL1Source("C:\ConversionTool\TestData\UT\MultiSingleDCL\IN2.txt")
        '将COPY句整理成为单句
        FormatPL1Source()
        '分析指定行
        mXmlDocument = New XmlDocument
        txtPl1Source.Text = PL1Source(0)
        Using TestWriter As StreamWriter = New IO.StreamWriter("C:\ConversionTool\TestData\UT\MultiSingleDCL\OUT.xml")
            Dim RootNode As XmlElement = mXmlDocument.CreateElement("ROOT")
            For Each SingleNode In clsDataDefine.GetDataTree(PL1Source(0))
                RootNode.AppendChild(SingleNode)
            Next
            TestWriter.Write(RootNode.OuterXml)
        End Using
        WebBrowser1.Url = New Uri("C:\ConversionTool\TestData\UT\MultiSingleDCL\OUT.xml")
    End Sub
    Private Sub cmdTreeDCL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTreeDCL.Click
        '读取所有行
        ReadFileToPL1Source("C:\ConversionTool\TestData\UT\TreeDCL\IN.txt")
        '将COPY句整理成为单句
        FormatPL1Source()
        '分析指定行
        mXmlDocument = New XmlDocument
        txtPl1Source.Text = PL1Source(0)
        Using TestWriter As StreamWriter = New IO.StreamWriter("C:\ConversionTool\TestData\UT\TreeDCL\OUT.xml")
            For Each SingleNode In clsDataDefine.GetDataTree(PL1Source(0))
                TestWriter.Write(SingleNode.OuterXml)
            Next
        End Using
        WebBrowser1.Url = New Uri("C:\ConversionTool\TestData\UT\TreeDCL\OUT.xml")
    End Sub
End Class